float PID_Control(float setpoint, float actual) {
  static float integral = 0, prev_error = 0;
  float error = setpoint - actual;
  integral += error * dt;
  float derivative = (error - prev_error) / dt;
  prev_error = error;
  return Kp*error + Ki*integral + Kd*derivative;
}
// 调用DAC输出控制电压
HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, PID_Control(target_temp, sensor_temp));